
// 用来设置应用的路由
function config($urlRouterProvider,$stateProvider)
{
    //$routeProvider 管理路由跳转的服务
    //$stateProvider 状态管理
    //$urlRouterProvider 用于监听$location对象变化 当url地址发生改变的时候,就会去某个列表当中去匹配url地址

    //当访问不存在的url地址的时候，或者是没匹配到的url地址的时候，就默认访问到该界面去
    $urlRouterProvider.otherwise('/main');

    //配置路由的状态
    //当访问到/home的时候加载对应的控制器和模板
    $stateProvider.
    state('main',{
        url:'/main',
        templateUrl:"../src/Views/admin/main.html",
        controller:"MainController"
    })


    .state('system',{
        url:'/system',
        templateUrl:"../src/Views/admin/system.html",
        controller:"SystemController"
    })



    
    // 食品管理的路由
    .state('food_list',{
        url:'/food_list',
        templateUrl:"../src/Views/admin/food_list.html",
        controller:"FoodListController"
    })
    .state('food_edit',{
        url:'/food_edit/:food_id',
        templateUrl:"../src/Views/admin/food_edit.html",
        controller:"FoodEditController"
    })
    .state('food_add',{
        url:'/food_add',
        templateUrl:"../src/Views/admin/food_add.html",
        controller:"FoodAddController"
    })
     .state('food_delete',{
        url:'/food_delete/:food_id',
        controller:"FoodDeleteController"
    })

     // 食品分类的路由
    
    .state('catefood_list',{
        url:'/catefood_list',
        templateUrl:"../src/Views/admin/catefood_list.html",
        controller:"CateFoodListController"
    })
    .state('catefood_edit',{
        url:'/catefood_edit/:fcate_id',
        templateUrl:"../src/Views/admin/catefood_edit.html",
        controller:"CateFoodEditController"
    })
    .state('catefood_add',{
        url:'/catefood_add',
        templateUrl:"../src/Views/admin/catefood_add.html",
        controller:"CateFoodAddController"
    })
     .state('catefood_delete',{
        url:'/catefood_delete/:fcate_id',
        controller:"CateFoodDeleteController"
    })

    // 文章管理的路由
    .state('article_list',{
        url:'/article_list',
        templateUrl:"../src/Views/admin/article_list.html",
        controller:'ArticleListController'

    })
    .state('article_add',{
        url:'/article_add',
        templateUrl:'../src/Views/admin/article_add.html',
        controller:'ArticleAddConroller'
    })
    .state('article_edite',{
        url:'/article_edite/:art_id',
        templateUrl:'../src/Views/admin/article_edite.html',
        controller:'ArticleEditeConroller'
    })
    .state('article_delete',{
        url:'/article_delete/:art_id',
        controller:'ArticleDeleteConroller'
    })
    // 文章主类路由
    .state('article_cate_list',{
        url:'/article_cate_list',
        templateUrl:'../src/Views/admin/article_cate_list.html',
        controller:'ArticleCateListConroller'
    })
    .state('article_cate_add',{
        url:'/article_cate_add',
        templateUrl:'../src/Views/admin/article_cate_add.html',
        controller:'ArticleCateAddConroller'
    })
    .state('article_cate_edite',{
        url:'/article_cate_edite/:artcate_id',
        templateUrl:'../src/Views/admin/article_cate_edite.html',
        controller:'ArticleCateEditeConroller'
    })
    .state('article_cate_delete',{
        url:'/article_cate_delete/:artcate_id',
        controller:'ArticleCateDeleteConroller'
    })
    // 店面管理路由文件
    .state('shop_list',{
        url:'/shop_list',
        templateUrl:'../src/Views/admin/shop_list.html',
        controller:'ShopListConroller'
    })
    .state('shop_add',{
        url:'/shop_add',
        templateUrl:'../src/Views/admin/shop_add.html',
        controller:'ShopAddConroller'
    })
    .state('shop_edite',{
        url:'/shop_edite/:shop_id',
        templateUrl:'../src/Views/admin/shop_edite.html',
        controller:'ShopEditeConroller'
    })
    .state('shop_delete',{
        url:'/shop_delete/:shop_id',
        controller:'ShopDeleteConroller'
    })


    // 地区主类的路由
    
    .state('region_list',{
        url:'/region_list',
        templateUrl:'../src/Views/admin/region_list.html',
        controller:'RegionListConroller'
    })
    .state('region_add',{
        url:'/region_add',
        templateUrl:'../src/Views/admin/region_add.html',
        controller:'RegionAddConroller'
    })
    .state('region_edite',{
        url:'/region_edite/:region_id',
        templateUrl:'../src/Views/admin/region_edite.html',
        controller:'RegionEditeConroller'
    })
    .state('region_delete',{
        url:'/region_delete/:region_id',
        controller:'RegionDeleteConroller'
    })

    // 友情链接路由
    .state('link_list',{
        url:'/link_list',
        templateUrl:'../src/Views/admin/link_list.html',
        controller:'LinkListConroller'
    })
    .state('link_add',{
        url:'/link_add',
        templateUrl:'../src/Views/admin/link_add.html',
        controller:'LinkAddConroller'
    })
    .state('link_edite',{
        url:'/link_edite/:link_id',
        templateUrl:'../src/Views/admin/link_edite.html',
        controller:'LinkEditeConroller'
    })
    .state('link_delete',{
        url:'/link_delete/:link_id',
        controller:'LinkDeleteConroller'
    })
    // 公司管理的路由
   
   .state('company_list',{
        url:'/company_list',
        templateUrl:'../src/Views/admin/company_list.html',
        controller:'CompanyListConroller'
    })
    .state('company_add',{
        url:'/company_add',
        templateUrl:'../src/Views/admin/company_add.html',
        controller:'CompanyAddConroller'
    })
    .state('company_edite',{
        url:'/company_edite/:company_id',
        templateUrl:'../src/Views/admin/company_edite.html',
        controller:'CompanyEditeConroller'
    })
    .state('company_delete',{
        url:'/company_delete/:company_id',
        controller:'CompanyDeleteConroller'
    })
    // 管理员的路由
    
    .state('admin_list',{
        url:'/admin_list',
        templateUrl:'../src/Views/admin/admin_list.html',
        controller:'AdminListConroller'
    })
    .state('admin_add',{
        url:'/admin_add',
        templateUrl:'../src/Views/admin/admin_add.html',
        controller:'AdminAddConroller'
    })
    .state('admin_edite',{
        // 这是路由的地址
        url:'/admin_edite/:admin_id',
        templateUrl:'../src/Views/admin/admin_edite.html',
        controller:'AdminEditeConroller'
    })
    .state('admin_delete',{
        url:'/admin_delete/:admin_id',
        controller:'AdminDeleteConroller'
    })
    // admin_action
    
    .state('admin_action',{
        url:'/admin_action/:admin_id',
        templateUrl:'../src/Views/admin/admin_action.html',
        controller:'AdminActionConroller'
    })
    .state('login',{
        url:'/login',
        templateUrl:"../src/Views/admin/login.html",
        controller:"LoginController"
    });


}







//将配置选项设置到当前应用中去
food.config(config).run();
